<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">

        function Person() {
        }
        var friend = new Person();
        friend.name="wangwu"
        Person.prototype.name="lisi"
        Person.prototype.sayName = function () {
            console.log(this)
            console.log(this.name);
        }
        friend.__proto__.sayName()

        function Teacher(){}
        function Student(){

        }
        Teacher.prototype=new Person()
        console.log(new Teacher())
        Student.prototype=Person.prototype
        console.log(new Student())
        
    </script>
</body>

</html>